<?php
class MsepCore_Bootstrap extends Engine_Application_Bootstrap_Abstract {
	
	public function __construct($application) {
		parent::__construct ( $application );
		
		// DO NOT LOAD AGAIN
		if (! $this->getContainer ()->isRegistered ( 'MsepCore' )) {
			$this->getContainer ()->set ( 'MsepCore', true );
			
			$view = $this->getContainer ()->get ( 'Zend_View' );
			
			$onloadScript = "
                        msep.core.baseUrl = '" . str_replace ( "/", "\/", str_replace ( '/index.php', '', $_SERVER ['SCRIPT_NAME'] ) ) . "/';
                        msep.core.baseUrlRaw = '" . str_replace ( '/index.php', '', $_SERVER ['SCRIPT_NAME'] ) . "/';
                  ";
			
			$view->headScript ()->prependScript ( $onloadScript )->prependFile ( 'application/modules/MsepCore/externals/scripts/core.js', 'text/javascript' );
		}
	}

}